package com.lagou.edu.test;

import org.junit.Test;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;

public class User {

    private String name;
    private String password;
    private String email;
    private String address;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    private ConcurrentHashMap<String, List<String>> listMap=new ConcurrentHashMap<>();

    //遍历
    public void print(){
        for(ConcurrentHashMap.Entry<String,List<String>>  map:listMap.entrySet()){
            System.out.print(map.getKey());
            for(String str:map.getValue()){
                System.out.print(str+"==");
            }
        }
    }

    public void init(){
        List<String> list=new ArrayList<>();
        list.add("张三");
        list.add("李四");
        list.add("王五");
        listMap.put("name",list);
    }
    @Test
    public void test(){
        User user = new User();
        user.init();
        user.print();
    }
}
